package com.container.app.testclasses.providerexample;

import com.container.app.ContainerProvider;
import com.container.app.annotations.Component;
import com.container.app.annotations.Inject;

/**
 * Created with IntelliJ IDEA.
 * User: Georgiana.Scarlat
 * Date: 7/13/12
 * Time: 9:26 AM
 */
@SuppressWarnings("UnusedDeclaration")
@Component
public class MagicNumber {
    private ContainerProvider<RandomPicking> pickingProvider;

    @Inject
    public void setPickingProvider(ContainerProvider<RandomPicking> pickingProvider) {
        this.pickingProvider = pickingProvider;
    }

    public Number magicNumber() {
        RandomPicking randomPicking = pickingProvider.get();
        Number n = randomPicking.pick();
        randomPicking.setPhony(12);
        return n;
    }

    public Number noMagicNumber() {
        RandomPicking randomPicking = pickingProvider.get();
        return randomPicking.pickPhony();

    }
}
